package com.yunwuliu.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunwuliu.bean.TUser;
import com.yunwuliu.mapper.TUserMapper;
import com.yunwuliu.request.LoginRequest;
import com.yunwuliu.service.LoginService;
import com.yunwuliu.service.TUserService;
import org.springframework.stereotype.Service;

/**
 * @author 16375
 * @version 1.0
 * @description: TODO
 * @date 2025/8/12 16:10
 */
@Service
public class LoginServiceImpl extends ServiceImpl<TUserMapper, TUser>
        implements TUserService, LoginService {

    /**
     * @param request
     */
    @Override
    public int login(LoginRequest request) {
        QueryWrapper<TUser> queryWrapper =  new QueryWrapper<>();
        queryWrapper.eq("user_password",request.getUserPassword());
        queryWrapper.eq("user_name",request.getUserName());
        baseMapper.exists( queryWrapper);
        return 1;
    }
}
